<!--
  Generated template for the ToPayPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>支付</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding-bottom>
  <ion-list class="order-detail">
    <ion-item>
      <span class="order-type">订单：充电{{charge_uprice.charge_time}}小时</span>
      <span class="order-money" item-end>￥{{charge_uprice.unit_price | number : '1.2-2'}}</span>
      <!--<div class="payExplain" (click)="payExplain()">支付说明</div>-->
    </ion-item>
  </ion-list>

  <ion-list class="pay-detail line-through">
    <ion-item tappable (click)="openData_statistics()">
      <span class="T-title">使用优惠券</span>
      <div class="T-link" item-right>
        <span class="T-link-result" *ngIf="coupons.coupon_name !== ''">{{coupons.coupon_name}}</span>
        <span class="T-link-result" *ngIf="coupons.coupon_name === ''">请选择</span>
        <span class="T-link-result"></span>
        <i class="iconfont icon-gengduo"></i>
      </div>
    </ion-item>
    <ion-item>
      <div class="money-detail">
        <span class="detail-title">订单金额：</span>
        <span class="detail-digital" float-right>￥{{charge_uprice.unit_price | number : '1.2-2'}}</span>
        <!-- number管道用来将数字处理为我们需要的小数格式 
             接收的参数格式为{最少整数位数}.{最少小数位数}-{最多小数位数} 
             其中最少整数位数默认为1 
             最少小数位数默认为0 
             最多小数位数默认为3 
             当小数位数少于规定的{最少小数位数}时，会自动补0 
             当小数位数多于规定的{最多小数位数}时，会四舍五入-->
      </div>
      <div class="money-detail">
        <span class="detail-title">优惠金额：</span>
        <span class="detail-digital" float-right>-￥{{coupons.denomination | number : '1.2-2'}}</span>
      </div>
    </ion-item>
    <ion-item class="no-line">
      <div class="sum-money" item-end>
        合计金额：
        <span class="digital">￥{{(charge_uprice.unit_price - coupons.denomination > 0 ? charge_uprice.unit_price - coupons.denomination : 0) | number : '1.2-2'}}</span>
      </div>
    </ion-item>
  </ion-list>

  <ion-list class="pay-type line-through" [(ngModel)]="paytype" radio-group>
    <ion-list-header>
      选择支付方式
    </ion-list-header>

    <ion-item *ngIf="Internet!=0">
      <img class="icon icon-account selectImg" src="assets/imgs/icon-account.png" item-left>
      <ion-label class="selectNow">账户余额
        <span class="account-blance">￥{{userInfo.balance}}</span>
      </ion-label>
      <ion-radio checked="true" value="4"></ion-radio>
    </ion-item>
    <ion-item *ngIf="Internet!=0">
      <img class="icon icon-account" src="assets/imgs/icon-weixin.png" item-left>
      <ion-label>微信支付</ion-label>
      <ion-radio value="1"></ion-radio>
    </ion-item>
    <ion-item *ngIf="Internet!=0">
      <img class="icon icon-account" src="assets/imgs/icon-zhifubao.png" item-left>
      <ion-label>支付宝支付</ion-label>
      <ion-radio value="2"></ion-radio>
    </ion-item>
    <ion-item *ngIf="Internet==0">
	  <img class="icon icon-account" src="assets/imgs/icon-bendi.png" item-left>      
	  	<ion-label>本地余额
        <span class="account-blance">￥{{userInfo.local_balance}}</span>
      </ion-label>
      <ion-radio checked="true" value="3"></ion-radio>
    </ion-item>
  </ion-list>
  
  
  <!--<button ion-button class="pay-button" (click)="create()">去支付</button>-->
</ion-content>
<div class="pay-module">
     <button ion-button class="pay-button" (click)="create()">去支付</button>
</div>